using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace Community.SharePoint.Utilities.Branding
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            try
            {
                if (Properties.Settings.Default.FirstRun)
                {
                    MessageBox.Show("Thank you for using the SharePoint Branding Tool v." + Properties.Resources.Version + ". \n\nYou will need to run this tool:\n1. On the SharePoint server where you are applying the changes\n2. With a user account that has privileges to update Themes and Site properties\n3.* With English version of SharePoint installed by default. \n\nNote: *You will need to modify the configuration file for other language versions to work. \n\nFor more information visit:\nhttp://www.codeplex.com/BrandingTool\nhttp://sharepointsix.blogspot.com", "SharePoint Branding Tool v."  + Properties.Resources.Version, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Properties.Settings.Default.FirstRun = false;
                    Properties.Settings.Default.Save();
                }
                Application.Run(new BrandingTool());
            }
            catch (Exception ex)
            {
                MessageBox.Show("An error with the following description has occurred. SharePoint Branding Tool will now terminate. \n\nError Details:\n" + ex.Message.ToString() + "\n\nStack Trace:\n" + ex.StackTrace.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
    }
}